#{extends 'noTab.html' /} 
#{set title:'Invite Organizers' /}

<body>
#{if view==0}
     <form action="@{Application.viewEntitiesOfOrg(orgId,1)}" method="POST">
     <h4> Select one or more entities that you want to assign organizers<h4/><br><br/>
     #{list items:orgEntities, as:'entitiesOfOrg'}
    <input type="checkbox" name="orgEntities" value='${entitiesOfOrg.id}' /> ${entitiesOfOrg.name}<br></br>
    #{/list}
   
<p>
<input type = submit value = ChooseOrganizers></input>
</p>
</form>
<form action="@{Browse.viewOrganization(orgId)}" method="POST">
<input type = submit value = Back></input></form>
#{/if}

#{if view==1}
#{if canBeAssigned.size()==0}
<h4> There are no organizers that can be assigned to one or more of the choosen entities<h4/>	
<form action="@{Application.viewEntitiesOfOrg(orgId,0)}" method="POST">
<input type = submit value = Back></input>
</form>
#{/if}
#{if canBeAssigned.size()!=0}
 <form action="@{Application.assignToEntity(userId,entitiesIDs,orgId)}" method="POST">
 
    <h4> Select the organizers that you want to assign to <h4/> ${entitiesString}<br><br/>
     #{list items:canBeAssigned, as:'userId'}
  <input type="radio" name="userId" value='${userId.id}'/> ${userId.name}  <br><br/>
    #{/list}
<p>
<input type = submit value = AssignToEntity></input>
</p></form>

<form action="@{Application.viewEntitiesOfOrg(orgId,0)}" method="POST">
<input type = submit value = Back></input></form>
#{/if}
#{/if}




